<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>

<style type="text/css">
/* <![CDATA[ */

table, td
{
    border-color: #666;
    border-style: solid;
}
table, th
{
    border-color: #666;
    border-style: solid;
}

table
{
    border-width: 0 0 1px 1px;
    border-spacing: 0;
    border-collapse: collapse;
}
 
td
{
    margin: 0;
    padding: 4px;
    border-width: 1px 1px 0 0;
}
th
{
    margin: 0;
    padding: 4px;
    border-width: 1px 1px 0 0;
}

/* ]]> */
</style>

<link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.0/css/jquery.dataTables.css">
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.2/themes/start/jquery-ui.css">
<link type="text/css" href="/css/1pxtable.css" rel="Stylesheet" />	
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.10.2.min.js"></script>
 <script src="//code.jquery.com/ui/1.10.2/jquery-ui.js"></script>
<script>
	$(function() {
		$( "#date_begin" ).datepicker({ dateFormat: "yy-mm-dd",firstDay: 1 });
	});
	$(function() {
		$( "#date_end" ).datepicker({ dateFormat: "yy-mm-dd",firstDay: 1 });
	});	
</script>
    
    
</head>
<body style="font-family:Arial, Helvetica, sans-serif">
<h1>Repair Parts Sales Summary : <?php echo $this->dateBegin?> to  <?php echo $this->dateEnd?>
</h1>
<form action="" method="post">
<table width="900" border="0" cellspacing="0" cellpadding="15">
  <tr>
    <td>Date Begin:</td>
    <td><input name="date_begin" id="date_begin" type="text"></td>
    <td>Date End:</td>
    <td><input name="date_end" id="date_end" type="text"></td>
  </tr>
</table>
<br />
<input type="submit" name="button" id="button" value="Search" />
</form> 
 <br />
<br />

 
<table width="1300" border="0" cellspacing="1" cellpadding="0" style="font-size:13px;" id="product_table">
<thead>
  <tr>
  	<th>No.</th>
    <th>Bar Code</th>
    <th>Description</th>
    <th>Sale Qty</th>
    <th>Faulty Qty</th>
    <th>Faulty Rate</th>
    <th>Wh Stock (Current)</th>
    <th>Wh Hold (Wk)</th>
    <th>Shop Stock (Current)</th>
    <th>Total Stock</th>
    <th>Total Hold (Wk)</th>
  </tr>
</thead>
<tfoot>
  <tr>
  	<th>No.</th>
    <th>Bar Code</th>
    <th>Description</th>
    <th>Sale Qty</th>
    <th>Faulty Qty</th>
    <th>Faulty Rate</th>
    <th>Wh Stock </th>
    <th>Wh Hold (Wk)</th>
    <th>Shop Stock</th>
    <th>Total Stock</th>
    <th>Total Hold (Wk)</th>
  </tr>
</tfoot>
<tbody>
<?php 
$cot = 1;
foreach($this->arrRes as $k => $v){?> 
    <tr>
    <td><?php echo $cot++?></td>
    <td><?php echo $v[0];?></td>
    <td><?php echo $v[1];?></td>
    <td><?php echo $v[2];?></td>
    <td><?php echo $v[4];?></td>
    <td><?php 
	echo ($v[2] > 0 )?round($v[4]/$v[2],4)*100:'100';
	?>%</td>
    <td><?php echo $v[5];?> ( -<?php echo $v[10];?> )</td>
    <td><?php echo $v[6];?></td>
    <td><?php echo $v[7];?></td>
    <td><?php echo $v[8];?></td>
    <td><?php echo $v[9];?></td>
  </tr>
<?php }?> 
</tbody> 
</table>
<br />
<br />

<div style=" font-size:10px; color:#666;float:left;" >Developer:Norman,Date:2015-01-30</div>
</body>

<script type="text/javascript" language="javascript" src="//cdn.datatables.net/1.10.0/js/jquery.dataTables.js"></script>

<script type="text/javascript">
$(document).ready(function() {
   oTable = $('#product_table').dataTable({
        "lengthMenu": [[-1, 50, 100,200], ["All", 50, 100,200]]
    } );
} );
</script>
</html>
